/**
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __AICPU_PROF_H__
#define __AICPU_PROF_H__

#include "aicpu_hccl_def.h"

enum class KfcTimeLine : int64_t {
    HCC_EXEC_START_TIME,
    SEND_TASK_START_TIME,
    SEND_SQE_FINISH_TIME,
};
class HcclCommProf {
public:
    static void SetCurrentProf(uint64_t launchTime);
    static void SetKfcTimeLine(KfcTimeLine kfcTimeLine);
    static void SetDebugMode(uint8_t debugMode);
    static bool IsDebugModeEquals(const uint8_t mode);
    static bool NeedRecordTimeTaken();
    static AicpuComProf *GetCurrentAicpuProf();
    static void OutputProfLog();
    static uint32_t GetCurrentLoopCnt();
    static void AddRcdCnt(uint32_t idx, int32_t sqeCnt);
    static void AddProfLoopCnt(uint32_t addCnt);
private:
    static AicpuComProf *GetaicpuProfInst();
    static uint32_t GetProfTotalCnt();
    static void AddProfTotalCnt(uint32_t addCnt);
    static void SetProfLoopCnt(uint32_t setCnt);
    static void OutputWorkProfLog(u32 workRcdCnt, u32 i);
    static uint8_t debugMode_;
};
#endif  // __AICPU_PROF_H__